package cn.edu.scau.cmi.xuandingcong.comprehensiveExperiment;

import cn.edu.scau.cmi.xuandingcong.client.AbstractFactoryClient;
import cn.edu.scau.cmi.xuandingcong.client.AdapterClient;
import cn.edu.scau.cmi.xuandingcong.client.ConsistentCompositeClient;
import cn.edu.scau.cmi.xuandingcong.client.FactoryClient;
import cn.edu.scau.cmi.xuandingcong.client.MultipletonClient;
import cn.edu.scau.cmi.xuandingcong.client.SafeCompositeClient;
import cn.edu.scau.cmi.xuandingcong.client.SimpleFactoryMethodClient;
import cn.edu.scau.cmi.xuandingcong.client.SingletonClient;
import cn.edu.scau.cmi.xuandingcong.singleton.SingletonDomain;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class ComprehensiveExperimentDomain {
	@FXML 
	private Button button1;
	@FXML 
	private Button button2;
	@FXML 
	private Button button3;
	@FXML 
	private Button button4;
	@FXML 
	private Button button5;
	@FXML 
	private Button button6;
	@FXML 
	private Button button7;
	@FXML 
	private Button button8;
	@FXML 
	private Button button9;
	
	public void comprehensiveExperiment() {
		button1.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent primaryStage) {
				// TODO Auto-generated method stub
				SingletonClient s = new SingletonClient();
				Stage mainStage=new Stage();
				try {
					s.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		
		button2.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				MultipletonClient m = new MultipletonClient();
				Stage mainStage=new Stage();
				try {
					m.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		
		button3.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				SimpleFactoryMethodClient simple = new SimpleFactoryMethodClient();
				Stage mainStage=new Stage();
				try {
					simple.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		
		button4.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				FactoryClient factory = new FactoryClient();
				Stage mainStage=new Stage();
				try {
					factory.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		
		button5.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				AbstractFactoryClient abstractFactory = new AbstractFactoryClient();
				Stage mainStage=new Stage();
				try {
					abstractFactory.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		
		button6.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				AdapterClient adapter = new AdapterClient();
				Stage mainStage=new Stage();
				try {
					adapter.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
		
		button7.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				ConsistentCompositeClient c = new ConsistentCompositeClient();
				Stage mainStage=new Stage();
				
					try {
						c.start(mainStage);
					} catch (Exception e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				
			}
		});
		
		button8.setOnAction(new EventHandler<ActionEvent>() {
			
			@Override
			public void handle(ActionEvent event) {
				// TODO Auto-generated method stub
				SafeCompositeClient sc = new SafeCompositeClient();
				Stage mainStage=new Stage();
				try {
					sc.start(mainStage);
				} catch (Exception e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		});
	}

}
